package com.feri.rbacsys.controller;

import com.feri.rbacsys.service.intf.CheckService;
import com.feri.rbacsys.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
    /**
     * @Author:陈琳琳
     */
    @RestController
    @RequestMapping("/api/check/")
    @Api(tags = "审核接口")
    public class CheckController {
        @Resource
        CheckService service;

        @PreAuthorize("hasAuthority('check:order')")
        @ApiOperation("审核该订单")
        @GetMapping("order")
        public R check(Integer oid){
            return service.checkOrder(oid);
        }
        @ApiOperation("审核退货申请")
        @GetMapping("torder")
        public R checkTorder(Integer tid){
            return service.checkTorder(tid);
        }
    }

